<template>
  <div class="tab-content">
    <div class="tab-main-content">
      <el-form
        ref="form"
        :model="form"
        label-width="120px"
        size="small"
        class="qr-form"
      >
        <el-form-item label="二维码链接">
          <el-input
            :disabled="true"
            v-model="form.qrUrl"
          ></el-input>
        </el-form-item>
      
      <div class="qr-action">
        <div class="qr-img">

        </div>
        <div class="qr-actions">
          <el-button
            plain
          >复制链接</el-button>
          <el-button type="primary">下载二维码</el-button>
        </div>
      </div>

      <el-form-item
        label="停车场图片"
        prop=""
      >
        <el-upload
          class="upload-demo"
          action=""
          :on-preview="handlePreview"
          :on-remove="handleRemove"
          :on-change="handleChange"
          :before-upload="beforeAvatarUpload"
          :file-list="fileList2"
          list-type="picture"
        >
          <el-button
            size="small"
            type="primary"
          >上传图片</el-button>
          <div
            slot="tip"
            class="el-upload__tip"
          >* LOGO高度不超过150px，宽度不超过200px，建议上传png格式的文件。</div>
        </el-upload>
      </el-form-item>

      </el-form>
    </div>
    <div class="qr-tips">
      <div class="title">车场管理方二维码-使用场景</div>
      <div class="tips-bd">
        多车场公用，支持车场管理费账号下所有车场在场车辆的查费缴费。
      </div>
    </div>
  </div>
</template>


<script>
export default {
  data() {
    return {
      form: {
        qrUrl: ""
      },
      fileList2: [
        {
          name: "food.jpeg",
          url:
            "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100"
        }
      ]
    };
  },
  methods: {
     handleRemove(file, fileList) {
      console.log(file, fileList);
    },
    handlePreview(file) {
      console.log(file);
    },
    handleChange(file, fileList) {
      console.log(fileList);
      this.fileList2 = fileList.slice(-1);
    },
    beforeAvatarUpload(file) {
      return false;
      // const isJPG = file.type === 'image/jpeg';
      // const isLt2M = file.size / 1024 / 1024 < 2;

      // if (!isJPG) {
      //   this.$message.error('上传头像图片只能是 JPG 格式!');
      // }
      // if (!isLt2M) {
      //   this.$message.error('上传头像图片大小不能超过 2MB!');
      // }
      // return isJPG && isLt2M;
    }
  }
};
</script>

<style lang='less' scoped>
@import "./index.less";
</style>
